Skip to content

test: require a real MCP call and cleanup during evaluation - #7474

Open
astrogilda wants to merge 7 commits into
google:mainfrom
astrogilda:codex/native-mcp-evaluation-contract-20261009
Open

astrogilda wants to merge 7 commits into
google:mainfrom
astrogilda:codex/native-mcp-evaluation-contract-20261009

Conversation

@astrogilda

Copy link
Copy Markdown
Contributor

The old MCP evaluation test catches every exception and still passes, and starts an unpinned npx server. A failed server, failed inference or unfinished cleanup can therefore look like a successful MCP check.

Replace it with a finite Python stdio peer and consume the complete native evaluation. Require the real tool call, native result, successful inference, a terminated child and released session. Controls refuse missing tools, model failure, isError, and failed cleanup before or after resource release.

Checked head 4d699bef over current main 3d11f9fe. Python 3.11 and 3.14 each pass 168 affected evaluation/session checks with MCP 2.3.0, plus 39 native/evaluation checks with MCP 1.30.0, with no skips. Pyink, isort, compliance and dependency checks pass.

copybara-service Bot pushed a commit that referenced this pull request Oct 12, 2026
`test_mcp_stdio_agent_no_runtime_error` in `test_local_eval_service.py`
spawned an unpinned `npx -y @modelcontextprotocol/server-filesystem` process
and caught every exception inside `perform_inference()`, allowing a failed MCP
server startup, failed inference, or unfinished cleanup to pass as a successful
test.

Replace it in `test_local_eval_service.py` with tests against a local finite
Python stdio MCP server that verify `LocalEvalService.perform_inference()`
executes the MCP tool call, receives the native tool result, completes model
inference, and closes the MCP server cleanly without cleanup warnings or
errors. Additional tests verify that toolset load failures log an error while
inference succeeds without the toolset's tools, MCP tool errors (`isError=True`)
are forwarded to the model while inference succeeds, model errors return
`InferenceStatus.FAILURE` and close the toolset, and toolset close errors are
logged while inference succeeds.

Pull Request: #7474

PiperOrigin-RevId: 997703943
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants